import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.util.Observable;


public class SliderFahrenheitGUI extends SliderGUI{

	public SliderFahrenheitGUI(TemperatureController controller, int h,
			int v) {
		super("Fahrenheit", controller, h, v, -20, 200);
		tempControl.addAdjustmentListener(new SlideListener());
	}

	@Override
	public void update(Observable t, Object o) {
		double temp = ((TemperatureModel) t).getF();
		tempControl.setValue((int) temp); // Move the slider thumb
	}

	class SlideListener implements AdjustmentListener {
		public void adjustmentValueChanged(AdjustmentEvent e) {
			controller.SetFahrenheitTemperature(tempControl.getValue());
		}
	}
}
